package org.NooLab.itexx.app.processes.comm;

import java.util.ArrayList;





public class CommPorts {

	ArrayList<CommPort> items = new ArrayList<CommPort>(); 
	int basePort = 8401;
	
	
	public CommPorts( int basePort, int nCommSlots){
		CommPort cp;
		int n;
		this.basePort = basePort;
		if (basePort<1100){
			basePort = 7101;
		}
		for (int i=0;i<nCommSlots;i++){
			n = 2*i;
			items.add( new CommPort(basePort+n,basePort+n+1) );
		}
		
		
		
	}

	public ArrayList<CommPort> getItems() {
		return items;
	}

	public void setItems(ArrayList<CommPort> items) {
		this.items = items;
	}

	public CommPort getPortsOfSlot(int index) {
		// 
		CommPort item=null; 
		if ((index>=0) && (index<items.size())){
			item = items.get(index);
		}
		return item;
	}
}
